package com.employees.action;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;

import com.employees.bean.Employee;
import com.employees.bean.Employeeinfo;
import com.employees.bean.Employeeskill;
import com.employees.service.EmployeeService;

public class EmployeeDeleteGroup extends Action {


	private EmployeeService employeeService;

	public void setEmployeeService(EmployeeService employeeService) {
		this.employeeService = employeeService;
	}

	@Override
	public ActionForward execute(ActionMapping mapping, ActionForm form,
			HttpServletRequest request, HttpServletResponse response)
			throws Exception {
		
		String[] employeeNo=request.getParameterValues("employeeNo");
		Employee e=new Employee();
		for(int i=0;employeeNo.length>i;i++){
			e.setNo(employeeNo[i]);
			employeeService.deleteEmployee(e);
		}
		
		return mapping.findForward("success");
	}
	
}
